# Contributor: Nicolas Lorin <androw95220@gmail.com>
# Maintainer: Nicolas Lorin <androw95220@gmail.com>
pkgname=dnscontrol
pkgver=4.14.2
pkgrel=0
pkgdesc="Synchronize your DNS to multiple providers from a simple DSL"
url="https://stackexchange.github.io/dnscontrol/"
arch="all"
license="MIT"
makedepends="go"
subpackages="$pkgname-doc"
options="net"
source="$pkgname-$pkgver.tar.gz::https://github.com/StackExchange/dnscontrol/archive/v$pkgver.tar.gz
	dnsconfig.js"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build
}

check() {
	./dnscontrol check --config ../dnsconfig.js
}

package() {
	install -Dm755 dnscontrol "$pkgdir"/usr/bin/dnscontrol
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
273e31ad7bcd4e32debacd1b347c3f30ea17c5f82d01ddb4542b927f890d368dc98fc5e4ff5a4d3719ad495a735c300e5e8a497217a478a4f310ce6b662456a8  dnscontrol-4.14.2.tar.gz
5503f149662dcf4d8548bc7e60bf566b2c4e7580593a15cca8f344f37103f413b860f4cb25ed38a620cf650528f133e4dc4d51824993b4e314acba5308a225d4  dnsconfig.js
"
